package cn.com.scitc.mapper;

import cn.com.scitc.model.Paidtypes;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

public interface PaidtypesMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table paidTypes
     *
     * @mbg.generated Tue May 23 08:10:41 CST 2023
     */
    @Delete({
        "delete from paidTypes",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table paidTypes
     *
     * @mbg.generated Tue May 23 08:10:41 CST 2023
     */
    @Insert({
        "insert into paidTypes (id, typeName, ",
        "sortOrder)",
        "values (#{id,jdbcType=INTEGER}, #{typename,jdbcType=VARCHAR}, ",
        "#{sortorder,jdbcType=INTEGER})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=true, resultType=Integer.class)
    int insert(Paidtypes row);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table paidTypes
     *
     * @mbg.generated Tue May 23 08:10:41 CST 2023
     */
    @Select({
        "select",
        "id, typeName, sortOrder",
        "from paidTypes",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="typeName", property="typename", jdbcType=JdbcType.VARCHAR),
        @Result(column="sortOrder", property="sortorder", jdbcType=JdbcType.INTEGER)
    })
    Paidtypes selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table paidTypes
     *
     * @mbg.generated Tue May 23 08:10:41 CST 2023
     */
    @Select({
        "select",
        "id, typeName, sortOrder",
        "from paidTypes"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="typeName", property="typename", jdbcType=JdbcType.VARCHAR),
        @Result(column="sortOrder", property="sortorder", jdbcType=JdbcType.INTEGER)
    })
    List<Paidtypes> selectAll();

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table paidTypes
     *
     * @mbg.generated Tue May 23 08:10:41 CST 2023
     */
    @Update({
        "update paidTypes",
        "set typeName = #{typename,jdbcType=VARCHAR},",
          "sortOrder = #{sortorder,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Paidtypes row);
}